function avgDist = averageDistance(x1, x2)

dist = [];
[a b] = size(x1);
for i=1:b
    xdist = x1(1,i) - x2(1,i);
    ydist = x1(2,i) - x2(2,i);
    xdist = xdist^2;
    ydist = ydist^2;
    act = sqrt(xdist + ydist);
    dist = [dist act];
end; 
avgDist = mean(dist);